home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / FireMan.swf / scripts / frame_1114 / PlaceObject2_530_76 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Text File  |  2008-09-12  |  3KB  |  121 lines

  1. onClipEvent(enterFrame){
  2.    function doexplode()
  3.    {
  4.       this.gotoAndStop("death");
  5.    }
  6.    function drawframe()
  7.    {
  8.       this.gotoAndStop("standing");
  9.    }
  10.    xi -= heroe.scrollspeed;
  11.    _X = _X - heroe.scrollspeed;
  12.    yi -= heroe.vscrollspeed;
  13.    _Y = _Y - heroe.vscrollspeed;
  14.    _visible = false;
  15.    hitable = this.hitTest(_parent.mascara);
  16.    if(hitable)
  17.    {
  18.       _visible = true;
  19.       if(this.sprite.hotzone.hitTest(heroe.sprite.hotzone))
  20.       {
  21.          heroe.damage = 2;
  22.          heroe.hitted = true;
  23.       }
  24.       if(this.sprite.hotzone.hitTest(_root.shoot1) && hitable)
  25.       {
  26.          hitted = true;
  27.          _root.shoot1.impact = true;
  28.          _root.hitted.start();
  29.       }
  30.       if(timerdamage == 0 && hitted)
  31.       {
  32.          timerdamage = FLASHTIME;
  33.          currentdamage += DAMAGE;
  34.       }
  35.       if(timerdamage > 0)
  36.       {
  37.          flashing = true;
  38.          timerdamage--;
  39.       }
  40.       if(flashing && timerdamage == 0)
  41.       {
  42.          flashing = false;
  43.          hitted = false;
  44.       }
  45.       if(currentdamage >= MAXDAMAGE)
  46.       {
  47.          death = true;
  48.          delete shoot;
  49.       }
  50.       if(death && !du)
  51.       {
  52.          _root.shoot1.impact = false;
  53.          du = true;
  54.          doexplode();
  55.       }
  56.    }
  57.    if(!death)
  58.    {
  59.       if(descending)
  60.       {
  61.          heroe.DAMAGE = 2;
  62.          dy = 3;
  63.          _Y = _Y + dy;
  64.          if(_Y >= heroe._y - heroe._height / 2 - 64 && heroe.vertical == 0)
  65.          {
  66.             dy = 0;
  67.             descending = false;
  68.             attack = true;
  69.             shoot = new Sound();
  70.             shoot.attachSound("mflyershoot");
  71.             if(_X > heroe._x)
  72.             {
  73.                dx = SPEED;
  74.                forward = false;
  75.             }
  76.             else
  77.             {
  78.                dx = -1 * SPEED;
  79.                forward = true;
  80.             }
  81.          }
  82.       }
  83.       if(attack && !attacking)
  84.       {
  85.          attacking = true;
  86.          this.attachMovie("bullet","b1",1);
  87.          this.attachMovie("bullet","b2",2);
  88.          shoot.start();
  89.          b1.control.dx = 2;
  90.          b1.control.dy = 2;
  91.          b1._x = -8;
  92.          b1._y += 13;
  93.          b2.control.dx = -2;
  94.          b2.control.dy = 2;
  95.          b2._x = 8;
  96.          b2._y += 13;
  97.          wait = true;
  98.          c = 0;
  99.       }
  100.       if(wait)
  101.       {
  102.          c += 1;
  103.          if(c >= DELAY)
  104.          {
  105.             wait = false;
  106.             leave = true;
  107.             dy = 3;
  108.          }
  109.       }
  110.       if(leave)
  111.       {
  112.          _Y = _Y + dy;
  113.          if(_Y >= 240)
  114.          {
  115.             this.removeMovieClip();
  116.          }
  117.       }
  118.       drawframe();
  119.    }
  120. }
  121.